package com.wjh.service;

import com.wjh.bean.User;
import com.wjh.mapper.UserMaper;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service(value = "userService")
@Transactional
public class UserService {
    @Autowired
    private UserMaper maper;
    public User getuserbyid(int id){

        return maper.getuserbyid(id);
    }
    public void adduser(User user){
        maper.adduser(user);
    }
    public List<User> pagelist(){
        List<User> users=maper.pagelist();
        return users;
    }

}
